{extend name="public/base"/}
{block name="css"}
    <link href="{$Think.HOME_STATIC}css/library.css" rel="stylesheet">
    <link href="{$Think.HOME_STATIC}css/animate.min.css" rel="stylesheet">
{/block}

{block name="center_left"}
    <div id="navsecond" class="float-left">
        <div id="shelflist">
            <div class="title">
                <div class="float-left title-icon">
                    <i class="iconfont blog-tushuguan"></i>
                </div>
                <div class="float-left title-text">
                    <span>全部笔记</span>
                </div>
                <div class="clear"></div>
            </div>

            <div class="innerUl">
                <ul class="menuUl">
                    {volist name="$bookshelf_info" id="bookshelf_item"}
                    <li draggable="true" data-id="{$bookshelf_item.id}">
                        <i class="iconfont blog-wodeshujia add-operate"></i>
                        <span class="edit-bookshelf-name">{$bookshelf_item.shelf_name}</span>
                    </li>
                    {/volist}
                </ul>
            </div>
        </div>
    </div>
{/block}

{block name="center_main"}
<div id="maincontent" class="float-right">
    <div class="col">
        {volist name="$bookshelf_info" id="bookshelf_item"}
        <div class="bookcoverlist" data-id="{$bookshelf_item.id}">
            <div class="title">
                <div class="float-left title-icon">
                    <i class="iconfont blog-wodeshujia"></i>
                </div>
                <div class="float-left title-text">
                    <span>&nbsp;{$bookshelf_item.shelf_name} 全部笔记</span>
                </div>
                <div class="clear"></div>
            </div>
            {volist name="$bookcover_info" id="bookcover_item"}
            {if condition="$bookshelf_item.id == $bookcover_item.shelf_id"}
            <div class="bookcover float-left" data-id="{$bookcover_item.id}">
                <div class="bookcover-title">
                    <i class="iconfont blog-title"></i>
                    <span>[{$bookcover_item.cover_name}] 笔记</span>
                    <div class="clear"></div>
                </div>
                <div class="bookcover-content">
                    <div class="bookcover-img float-left">
                        <img src="{$bookcover_item.cover_pic_thumb}" onerror="javascript:this.src='/uploads/uploadpic.png';
                        this.title='{$bookcover_item.cover_name}图片丢失...'" alt="{$bookcover_item.cover_name}">
                    </div>
                    <div class="bookcover-describe float-left">
                        <p>{$bookcover_item.cover_describe}</p>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
            {/if}
            {/volist}

            <div class="clear"></div>
        </div>
        {/volist}
    </div>
</div>
{/block}

{block name="footer_js"}
<script type="text/javascript">
    if("{if condition='($login==1)'}1{/if}"){
        document.getElementById('LBox').className = 'LBoxShow';
    }
</script>
<script src="{$Think.STATIC_PATH}js/require.min.js"></script>
<script type="text/javascript">

    require.config({
        baseUrl: "{$Think.STATIC_PATH}",
        paths: {
            jquery : "js/jquery.min",
            operate: "home/js/bookshelf.operate",
            hDialog: "home/js/jquery.hDialog"
        },
        shim: {
            'hDialog': {
                deps: ['jquery']
            },
            'operate': {
                deps: ['hDialog']
            }
        },
        waitSeconds: 30
    });

    var deps = [
        "jquery",
        "operate",
        "hDialog"
    ];

    require(deps,function() {
        $("#center").Operate({
            notebookIndexUrl: "{:url('/home/notebook/index')}",
            callbackEdit: function (id) {
            }
        });
    });
</script>
{/block}